home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-10-31 | 923 b | 46 lines | [TEXT/MMCC] |
- //==================================================================
- // Failure.c <tur 26-Feb-94>
- //
- // Simple Error reporting.
- //
- // Currently just Macsbugs, but you can override this with your own
- // procedure. In any event, we do an ExitToShell().
- //
- //==================================================================
-
- #include <stdio.h>
- #include <stdarg.h>
- #ifndef __QUICKDRAW__
- #include <Types.h>
- #include <SegLoad.h>
- #endif
- #include "Failure.h"
-
-
- //==================================================================
-
- ShowFailureProc gShowFailProc;
-
- //==================================================================
-
-
- // Simple-minded error reportage...
-
- void Fail(const char *fmt, ...)
- {
- va_list args;
- char buf[256];
-
- va_start(args, fmt);
- buf[0] = vsprintf(buf+1, fmt, args);
- va_end(args);
-
- if (gShowFailProc)
- gShowFailProc((StringPtr)buf);
- else
- DebugStr((StringPtr)buf);
-
- ExitToShell();
- }
-
-